package com.party.core.model.member;

import com.party.core.model.BaseModel;

import java.util.Date;

/**
 * 商户会员关系
 * Created by wei.li
 *
 * @date 2017/9/20 0020
 * @time 11:46
 */
public class PartnerMember extends BaseModel {


    //合作商编号
    private String partnerId;

    //会员编号
    private String memberId;

    //用户编号(客户自定义填写)
    private String userSerial;

    //会员所属主机构
    private Integer partnerType;

    //主分社
    public static  final Integer IS_MAIN_TYPE = 1;

    public PartnerMember() {
    }

    public PartnerMember(String partnerId, String memberId) {
        this.partnerId = partnerId;
        this.memberId = memberId;
    }

    public PartnerMember(String partnerId, String memberId, Date createDate) {
        this.partnerId = partnerId;
        this.memberId = memberId;
        super.setCreateDate(createDate);
    }

    public Integer getPartnerType() {
        return partnerType;
    }

    public void setPartnerType(Integer partnerType) {
        this.partnerType = partnerType;
    }

    public String getPartnerId() {
        return partnerId;
    }

    public void setPartnerId(String partnerId) {
        this.partnerId = partnerId;
    }

    public String getMemberId() {
        return memberId;
    }

    public void setMemberId(String memberId) {
        this.memberId = memberId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        PartnerMember that = (PartnerMember) o;

        if (partnerId != null ? !partnerId.equals(that.partnerId) : that.partnerId != null) return false;
        return memberId != null ? memberId.equals(that.memberId) : that.memberId == null;

    }

    @Override
    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (partnerId != null ? partnerId.hashCode() : 0);
        result = 31 * result + (memberId != null ? memberId.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "PartnerMember{" +
                "partnerId='" + partnerId + '\'' +
                ", memberId='" + memberId + '\'' +
                '}';
    }

    public String getUserSerial() {
        return userSerial;
    }

    public void setUserSerial(String userSerial) {
        this.userSerial = userSerial;
    }
}
